{$ifdef interface}
type
  TAppDatabaseTab = class
    public
      sheet: TTabSheet;
      grid: TAppDataGrid;
      constructor Create(AOwner:TPageControl);
      procedure loadGrid(table:string);
    private
  end;

var database: TAppDatabaseTab;
{$endif}

{$ifdef implementation}

constructor TAppDatabaseTab.Create(AOwner:TPageControl);
begin
  inherited Create;
  sheet := TTabSheet.Create(AOwner);
  sheet.Caption:='Query ';
  sheet.Parent:=AOwner;
  sheet.PageControl:=AOwner;

  self.grid:=TAppDataGrid.Create(nil);
  self.grid.Parent:=sheet;
  self.grid.Align:=alClient;
end;

procedure TAppDatabaseTab.loadGrid(table:string);
var sql:string;
begin
  sql := format('SHOW TABLE STATUS FROM `%s`',[table]);
  db.loadDataFromSQL(sql,self.grid,'Name=Name,Engine=Engine,Rows=Rows,Data_length=Size,Index_length=Index Size,Collation=Collation,Comment=Comment');
end;



{$endif}

{$ifdef initialization}

{$endif}
